import React ,{useEffect,useState}from 'react'
import Swiper from 'swiper'
import './index.css'
import { getshop } from '../../../api/request'

export default function Swipers() {
    const[shop,setShop]=useState([]) 
    useEffect(()=>{
        new Swiper('.btn-banners',{
            loop:true,
           autoplay:{
            delay:1000
           }
        })
    })
    useEffect(()=>{
        (async()=>{
            let {data}=await getshop()
            setShop(data)
        })()
    },[])
  return (
    <div>
      <div className="btn-banners swiper-container">
            <div className="swiper-wrapper">
                {
                      shop.map(item=>(
                         <div className="swiper-slide">
                           <img src={item.images} alt="" /> </div>
                      ))
               
                }
              
                
            </div>
        </div>
    </div>
  )
}
